<?php
/*  Feed2JS : RSS feed to JavaScript Style Maker
	style.php
	
	ABOUT
	This script can be used to select and create variations
	of style sheets used for Feed2JS
		
	Developed by Alan Levine 26.may.2004
	http:/jade.mcli.dist.maricopa.edu/alan/
	
	MORE:
	Part of the Feed2JS package
	See http://jade.mcli.dist.maricopa.edu/feed/

*/


	
// POSTED VARIABLES ---------------------------------------------
// get PHP variables
	
	$feed = $_REQUEST['feed'];
	$flavor = $_REQUEST['flavor'];
	
	include 'style/style_pile.php';
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Stylize Your JavaScript RSS Feed</title>
	<link rel="stylesheet" href="style/main.css" media="all" />

</head>
<body>
<div id="content">

<h1>Feed2JS: Style a Feed</h1>
<p>Once you have <a href="build.php">built the code for your Feed2JS</a>, you can see how the output of RSS content generated by Feed2JS can be customized by applying different style sheets. Each part of the feed has an identifier, allowing you to add styles to the box containing the feeds, the title, the item display, and the date posting text. A few sample styles are provided here; for more, see the <a href="http://jade.mcli.dist.maricopa.edu/feed/index.php?s=style">Feed2JS Style Center</a>.
</p>

<form method="post" action="style_preview.php" target="sty">
<h2>Try on a Style Sheet</h2>
<p><strong>URL</strong> Enter the web address for the RSS Feed to "stylize"; if you do not have one handy, you can use the one below from <a href="http://jade.mcli.dist.maricopa.edu//alan/">CogDogBlog</a>.<br />
<input type="text" name="feed" size="50" value="<?php if ($feed) {echo urldecode($feed);} else {echo 'http://jade.mcli.dist.maricopa.edu/alan/index.xml';}?>"></p>

<p><strong>Style Selector</strong><br>
These are but a  few style varieties to sample- you are invited to modify or create your own. If you have a snazzy, prettier version, please send it our way. For a blank slate, select the "none/template" style.<br>
<select name="flavor">
<option value="">Select a style...</option>

<?php
	foreach ($mystyles as $cname => $ctitle) {
		if ($flavor == $cname) {
			$selected = 'selected';
		} else {
			$selected = '';
		}
	
		echo "<option value=\"$cname\" $selected>$ctitle</option>";
	}
?>
</select>
<input type="submit" value="style this feed!" />
</p>

</form>

<h2>Using a Style Sheet</h2>
<p>You will need to incorporate the CSS code or linkage in your own HTML files; there are two ways you can do this:</p>

<ol class="spread">
<li><strong>Insert the CSS directly into the HTML for the page that will display the feed.</strong> This methods is best for sites that only are displaying the feed on one or a few pages. Use the form below to find the style you desire, copy the CSS, and paste it somewhere into the <code>&lt;HEAD&gt;...&lt;/HEAD&gt;</code> of your HTML file that contains the Feed2JS code, surrounded by the <code>&lt;style&gt;...&lt;/style&gt;</code> tags shown below.
<pre>&lt;style type="text/css"  media="all"&gt;

&lt;!--  this is where you paste the CSS provided by the form below --&gt;

&lt;/style&gt;</pre></li>

<li><strong>Link to an external style sheet.</strong> This method is best if you will be using the feeds on multiple pages, as the CSS is stored externally, and thus allows you to change the output display of many pages by editing a single file. Just copy the CSS provided by the form below, and paste it into a new text file. Save it as something called "myfeed.css". Think smart about where you decided to store this file, as other HTML pages that call it need to define a correct path to the file. Many web sites just create a top level directory named <code>style</code> and store all style sheet files in this directory.<br><br>
Regardless, to connect the HTML file that contains the Feed2JS code to an external style sheet, insert this line into the <code>&lt;HEAD&gt;...&lt;/HEAD&gt;</code> of your HTML.
<pre>
&lt;link rel="stylesheet" href="style/myfeed.css" media="all"&gt;
</pre>
Remember again that the value of <code>href=</code> must be a correct relative path (or a full valid URL such as http://www.blah.com/style/myfeed.css) from the HTML file to the CSS file.</li>
</ol>

<h4>CSS classes</h4>
<img src="style/css_classes.gif" alt="" width="360" height="223" border="0" align="right">
<p>This sketch represents the CSS classes created by Feed2JS.</p>
<ul class="nospread">
<li><strong>rss_box</strong> defines the bounding div for the entire display- use to define borders, fill, etc.</li>
<li><strong>rss_title</strong> the title of the feed and link style if displayed. Use with variants of <code>rss_title a:link, rss_title a:hover</code>, etc for rollowver styles</li>
<li><strong>rss_items</strong> defines the unordered list <code>&lt;ul&gt;...&lt;/ul&gt;</code> for the feed items- use to define the padding/margins for items.</li>
<li><strong>rss_item</strong> display of each feed item description and title, <code>&lt;li&gt;...&lt;/li&gt;</code> as well as the channel description, if displayed.</li> 
<li><strong>rss_item a:</strong>  variant for the item title and link style</li>
<li><strong>rss_date</strong>  defines the display of item posting dates</li>
</ul>

<br clear="right">

</div>

<?php include 'footer'?>

</body>
</html>
